package com.szxx.mahjong.qianjiang.async.handler;

import com.szxx.async.handler.AsyncLogicHandleThread;
import com.szxx.mahjong.qianjiang.processor.QianjiangGameLogicProcessor;
import com.szxx.processor.mahjong.MahjongProcessor;
import com.szxx.rule.DealRule;
import com.szxx.rule.WashCardRule;
import com.szxx.rule.support.DefaultDealRule;
import com.szxx.rule.support.DefaultWashCardRule;
import com.szxx.service.IMachineService;
import com.szxx.service.IPlayerService;
import com.szxx.service.ISystemConfigService;

/**
 * Created by zjh on 2017/4/26.
 */
public class QianjiangAsyncLogicHandleThread extends AsyncLogicHandleThread{


    public QianjiangAsyncLogicHandleThread(int threadIndex,ISystemConfigService cfgService, IMachineService machineService,
                                           MahjongProcessor mahjongProcessor, IPlayerService playerService) {
        super(threadIndex,cfgService, machineService, mahjongProcessor, playerService);
    }

    /**
     * 初始化gamelogicProcessor
     */
    @Override
    public void initGameLoicProcessor() {
        //发牌器
        DealRule dealRule = new DefaultDealRule();
        //洗牌器
        WashCardRule washCardRule = new DefaultWashCardRule();
        washCardRule.setContainHua(false);
        washCardRule.setContainZi(false);
        this.gameLogic = new QianjiangGameLogicProcessor(playerService, machineService, cfgService, mahjongProcessor
                , dealRule, washCardRule);
        gameLogic.setLogicThreadId(getThreadIndex());
    }
}
